<?php

namespace app\cash\model;

use app\common\model\CommonModel;
use think\facade\Db;


class GoodsSkuModel extends CommonModel{

    protected  $name = 'beautiful_goods_sku';

    protected  $pk   = 'sku_id';

    public static function info($where,$field){
        $json = [];
        if($field=='*'){
            $json[] = 'discount_detail';
        }else{
            $arr = explode(',',$field);
            if(in_array('discount_detail',$arr)){
                $json[] = 'discount_detail';
            }
        }
        $list = self::where($where)->json($json,true)->field($field)->find();
        return $list;
    }

}

